package com.ruoyi.decision.service.impl;

import com.ruoyi.decision.domain.StrategyConfigure;
import com.ruoyi.decision.mapper.StrategyConfigureMapper;
import com.ruoyi.decision.service.IStrategyConfigureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Locale;
import java.util.UUID;

/**
 * 优化策略模型配置Service业务层处理
 * 
 * @author zbw
 * @date 2022-07-20
 */
@Service
public class StrategyConfigureServiceImpl implements IStrategyConfigureService 
{
    @Autowired
    private StrategyConfigureMapper strategyConfigureMapper;

    /**
     * 查询优化策略模型配置
     * 
     * @param id 优化策略模型配置主键
     * @return 优化策略模型配置
     */
    @Override
    public StrategyConfigure selectStrategyConfigureById(String id)
    {
        return strategyConfigureMapper.selectStrategyConfigureById(id);
    }

    /**
     * 查询优化策略模型配置列表
     * 
     * @param strategyConfigure 优化策略模型配置
     * @return 优化策略模型配置
     */
    @Override
    public List<StrategyConfigure> selectStrategyConfigureList(StrategyConfigure strategyConfigure)
    {
        return strategyConfigureMapper.selectStrategyConfigureList(strategyConfigure);
    }

    /**
     * 新增优化策略模型配置
     * 
     * @param strategyConfigure 优化策略模型配置
     * @return 结果
     */
    @Override
    public int insertStrategyConfigure(StrategyConfigure strategyConfigure)
    {
        String id = UUID.randomUUID().toString().toLowerCase(Locale.ROOT).replace("-","");
        strategyConfigure.setId(id);
        return strategyConfigureMapper.insertStrategyConfigure(strategyConfigure);
    }

    /**
     * 修改优化策略模型配置
     * 
     * @param strategyConfigure 优化策略模型配置
     * @return 结果
     */
    @Override
    public int updateStrategyConfigure(StrategyConfigure strategyConfigure)
    {
        return strategyConfigureMapper.updateStrategyConfigure(strategyConfigure);
    }

    /**
     * 批量删除优化策略模型配置
     * 
     * @param ids 需要删除的优化策略模型配置主键
     * @return 结果
     */
    @Override
    public int deleteStrategyConfigureByIds(String[] ids)
    {
        return strategyConfigureMapper.deleteStrategyConfigureByIds(ids);
    }

    /**
     * 删除优化策略模型配置信息
     * 
     * @param id 优化策略模型配置主键
     * @return 结果
     */
    @Override
    public int deleteStrategyConfigureById(String id)
    {
        return strategyConfigureMapper.deleteStrategyConfigureById(id);
    }

    @Override
    public List<StrategyConfigure> selectStrategyConfigureByStrategyId(String strategyId) {
        return strategyConfigureMapper.selectStrategyConfigureByStrategyId(strategyId);
    }
}
